<template>
    <div class="login">
        <p class="login_info"></p>

        <!-- 登录主内容 -->
        <div class="container">
            <p class="login_title" style="">欢迎使用OA系统</p>
            <el-tabs class="login_tabs" v-model="activeName" @tab-click="handleTabs" style="">
                <el-tab-pane class="tabPane" label="钉钉扫码登录" name="first" style="">
                    <!-- 扫码登录 -->
                    <scanCode @upUrlLoading="redirectUrlLoading = true" />
                </el-tab-pane>
                <!-- 邮箱登录 -->
                <el-tab-pane class="tabPane" label="邮箱账号登录" name="second" style="padding-top:15px">
                    <emailLogin />
                </el-tab-pane> 
            </el-tabs>
        </div>

        <!-- 扫码登录蒙城 -->
        <div class="mask-box" v-if="redirectUrlLoading" v-loading="redirectUrlLoading" element-loading-text="登录中。。。。。">
        </div>
    </div>
</template>

<script setup>
import {ref } from "vue"

import scanCode from './components/ScanCode.vue'
import emailLogin from './components/emailLogin.vue'

// login tabs选项卡
const activeName = ref('first')

let redirectUrlLoading = ref(false) //扫码登录重新刷新的loading

const handleTabs = () => {
    console.log(11)
}
</script>


<style lang="scss" scoped>
.login{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: url(../../assets/image/login_bg.png);
    background-size: cover;
    .login_info{
        background: url(../../assets/image/login_word.png);
    }
    .container{
        position: absolute;
        top: 50%;
        right: 10%;
        margin-top: -200px;
        width: 500px;
        height: 550px;
        background: url(../../assets/image/code_bg.png);
        background-size: cover;
        .login_title{
            font-size:42px;color:rgba(56, 56, 56, 1);padding:30px 50px
        }
        .login_tabs{
            padding:0 14px;
            .tabPane{
                display:flex;
                justify-content: center;
                padding-top:15px;
                align-items: center;
            }
        }
    }
    .mask-box{
        // background: rgb(255, 255, 255, 0.85);
        width: 100%;
        height: 100%;
        z-index: 12;
        // opacity: 0.9;
    }
}

:deep.login_tabs  .el-tabs__nav{
    transform: translateX(37px) !important;
}
</style>